
<template>
  <h2>年龄: {{user_store.age}}</h2>
  <h3>等级: {{user_store.level}}</h3>
  <h3>账号: {{user_store.account}}</h3>
  <h3>昵称: {{user_store.nickname}}</h3>
  <hr>
  <button @click="user_store.nickname += '大大'">点修改昵称</button>
  <button @click="user_store.account += '1111'">点修改账号</button>
  <button @click="user_store.age += 2">点修改年龄</button>
  <button @click="user_store.level += '1'">点修改等级</button>
  <!--  <h1>mapWritableState映射的数据</h1>-->
  <!--  <h3>账号: {{account}}</h3>-->
  <!--  <h3>昵称: {{nickname}}</h3>-->
  <!--  <h2>年龄: {{user_age}}</h2>-->
  <!--  <h3>等级: {{user_level}}</h3>-->
  <!--  <button @click="nickname += '大大'">点修改昵称</button>-->
  <!--  <button @click="account += '1111'">点修改账号</button>-->
  <!--  <button @click="user_age += 2">点修改年龄</button>-->
  <!--  <button @click="user_level += '1'">点修改等级</button>-->
</template>
<script setup>
import { mapState,mapWritableState } from 'pinia'
import { useUserStore2 } from "../stores/useUserStore2";

// 获取对象实例
let user_store = useUserStore2()

</script>
